jeg har et problem med at få indput fra min mysql database og redigere i den, på min php side.
- <!DOCTYPE HTML>
- <html>
- <?php
- $ID = "";
- $name = "";
- $address = "";
- $postnr = "";
- $tlf = "";
- $email = "";
- $by = "";
- $maerke = "";
- $model = "";
- $serienr = "";
- $extraudstyr = "";
- $fejlbeskrivelse = "";
- $reparationudfortaf = "";
- $delpartnr1 = "";
- $delpartnr2 = "";
- $delpartnr3 = "";
- $delpartnr4 = "";
- $delpartnr5 = "";
- $delpartnr6 = "";
- $delpartnr7 = "";
- $delpartnr8 = "";
- $delpartnr9 = "";
- $delpartnr10 = "";
- $indlaveringsdato = "";
- $udlaveringsdato = "";
- $delpartpris1 = "";
- $delpartpris2 = "";
- $delpartpris3 = "";
- $delpartpris4 = "";
- $delpartpris5 = "";
- $delpartpris6 = "";
- $delpartpris7 = "";
- $delpartpris8 = "";
- $delpartpris9 = "";
- $delpartpris10 = "";
- $tstart = "";
- $tslut = "";
- $tforbrug = "";
- $total = "";
- $kkm = "";
- $krute = "";
- ?>
- <head>
- <title>Jobseddel SKP DATA</title>
- <meta name="description" content="website description" />
- <meta name="keywords" content="website keywords, website keywords" />
- <meta http-equiv="content-type" content="text/html; charset=windows-1252" />
- <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Tangerine&v1" />
- <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz" />
- <link rel="stylesheet" type="text/css" href="style/style.css" />
- </head>
-
- <body>
- <div id="main">
- <div id="header">
- <div id="logo">
- <h1>Jobseddel</h1>
- </div>
- <div id="menubar">
- <ul id="menu">
- <!-- put class="current" in the li tag for the selected page - to highlight which page you're on -->
- <li><a href="index.php">Hjem</a></li>
- <li><a href="opret.php">Opret job</a></li>
- <li><a href="findid.php">Find ID</a></li>
- <li><a href="findjob.php">Find job</a></li>
- <li class="current"><a href="rediger.php">Rediger job</a></li>
- <li><a href="slet.php">Slet job</a></li>
- </ul>
- </div>
- </div>
- <div id="site_content">
- <div id="content">
- <!-- insert the page content here -->
- <h1>Rediger Jobseddel</h1>
- <p>Her kan du redigere en jobseddel.</p>
-
- <form action="rediger.php" method="POST">
- ID: <input type="text" name="ID" tabindex="1"/><br/>
- <input type="submit" value="Find" name="find"/>
- <input type="submit" value="Gem" name="find"/>
- </form>
- <br/>
- <br/>
- <?php
- if (isset($_POST['find'])){
- switch ($_POST['find']){
- case 'Gem':
- $server = "localhost";
- $brugernavn = "root";
- $kode = "1234";
- $db = "skp-data";
- mysql_connect($server , $brugernavn , $kode) or die(mysql_error());
- echo "Forbundet til mysql server<br/>";
- mysql_select_db($db)or die(mysql_error());
- echo "Forbundet til databasen<br/><br/>";
- $ID2 = $_POST['ID2'];
- $name2 = $_POST['name'];
- $address2 = $_POST['address'];
- $postnr2 = $_POST['postnr'];
- $tlf2 = $_POST['tlf'];
- $email2 = $_POST['email'];
- $city2 = $_POST['by'];
- $maerke2 = $_POST['maerke'];
- $model2 = $_POST['model'];
- $serienr2 = $_POST['serienr'];
- $extraudstyr2 = $_POST['extraudstyr'];
- $fejlbeskrivelse2 = $_POST['fejlbeskrivelse'];
- $reparationudfortaf2 = $_POST['reparationudfortaf'];
- $delpartnr12 = $_POST['delpartnr1'];
- $delpartnr22 = $_POST['delpartnr2'];
- $delpartnr32 = $_POST['delpartnr3'];
- $delpartnr42 = $_POST['delpartnr4'];
- $delpartnr52 = $_POST['delpartnr5'];
- $delpartnr62 = $_POST['delpartnr6'];
- $delpartnr72 = $_POST['delpartnr7'];
- $delpartnr82 = $_POST['delpartnr8'];
- $delpartnr92 = $_POST['delpartnr9'];
- $delpartnr102 = $_POST['delpartnr10'];
- $indlaveringsdato2 = $_POST['indlaveringsdato'];
- $udlaveringsdato2 = $_POST['udlaveringsdato'];
- $delpartpris12 = $_POST['delpartpris1'];
- $delpartpris22 = $_POST['delpartpris2'];
- $delpartpris32 = $_POST['delpartpris3'];
- $delpartpris42 = $_POST['delpartpris4'];
- $delpartpris52 = $_POST['delpartpris5'];
- $delpartpris62 = $_POST['delpartpris6'];
- $delpartpris72 = $_POST['delpartpris7'];
- $delpartpris82 = $_POST['delpartpris8'];
- $delpartpris92 = $_POST['delpartpris9'];
- $delpartpris102 = $_POST['delpartpris10'];
- $tstart2 = $_POST['tstart'];
- $tslut2 = $_POST['tslut'];
- $tforbrug2 = $_POST['tforbrug'];
- $total2 = $_POST['total'];
- $kkm2 = $_POST['kkm'];
- $krute2 = $_POST['krute'];
-
- $tabeldata2 = "UPDATE jobseddel SET name = '$name2', address = '$address2', postnr = '$postnr2', tlf = '$tlf2', email = '$email2', city = '$city2', maerke = '$maerke2', model = '$model2', serienr = '$serienr2', extraudstyr = '$extraudstyr2', fejlbeskrivelse = '$fejlbeskrivelse2', reparationudfortaf = '$reparationudfortaf2', delpartnr1 = '$delpartnr12', delpartnr2 = '$delpartnr22', delpartnr3 = '$delpartnr32', delpartnr4 = '$delpartnr42', delpartnr5 = '$delpartnr52', delpartnr6 = '$delpartnr62', delpartnr7 = '$delpartnr72', delpartnr8 = '$delpartnr82', delpartnr9 = '$delpartnr92', delpartnr10 = '$delpartnr102', indlaveringsdato = '$indlaveringsdato2', udlaveringsdato = '$udlaveringsdato2', delpartpris1 = '$delpartpris12', delpartpris2 = '$delpartpris22', delpartpris3 = '$delpartpris32', delpartpris4 = '$delpartpris42', delpartpris5 = '$delpartpris52', delpartpris6 = '$delpartpris62', delpartpris7 = '$delpartpris72', delpartpris8 = '$delpartpris82', delpartpris9 = '$delpartpris92', delpartpris10 = '$delpartpris2', tstart = '$tstart2', tslut = '$tslut2', tforbrug = '$tforbrug2', total = '$total2', kkm = '$kkm2', krute = '$krute2' WHERE ID ='$ID2'";
- $resultat = mysql_query($tabeldata) or die(mysql_error());
-
- if($resultat) {
- echo "Din bruger blev registeret";
- }
- else {
- echo "";
- echo $tabeldata;
- }
- mysql_close();
- break;
- case 'Find':
- $server = "localhost";
- $brugernavn = "root";
- $kode = "1234";
- $db = "skp-data";
- $ID = $_POST['ID'];
- mysql_connect($server , $brugernavn , $kode) or die(mysql_error());
-
-
- mysql_select_db($db)or die(mysql_error());
-
-
- $data = mysql_query("SELECT * FROM jobseddel WHERE ID ='$ID'" ) or die(mysql_error());
- while ($info = mysql_fetch_array($data))
- {
- $ID = $info['ID'];
- $name = $info['name'];
- $address = $info['address'];
- $postnr = $info['postnr'];
- $tlf = $info['tlf'];
- $email = $info['email'];
- $by = $info['city'];
- $maerke = $info['maerke'];
- $model = $info['model'];
- $serienr = $info['serienr'];
- $extraudstyr = $info['extraudstyr'];
- $fejlbeskrivelse = $info['fejlbeskrivelse'];
- $reparationudfortaf = $info['reparationudfortaf'];
- $delpartnr1 = $info['delpartnr1'];
- $delpartnr2 = $info['delpartnr2'];
- $delpartnr3 = $info['delpartnr3'];
- $delpartnr4 = $info['delpartnr4'];
- $delpartnr5 = $info['delpartnr5'];
- $delpartnr6 = $info['delpartnr6'];
- $delpartnr7 = $info['delpartnr7'];
- $delpartnr8 = $info['delpartnr8'];
- $delpartnr9 = $info['delpartnr9'];
- $delpartnr10 = $info['delpartnr10'];
- $indlaveringsdato = $info['indlaveringsdato'];
- $udlaveringsdato = $info['udlaveringsdato'];
- $delpartpris1 = $info['delpartpris1'];
- $delpartpris2 = $info['delpartpris2'];
- $delpartpris3 = $info['delpartpris3'];
- $delpartpris4 = $info['delpartpris4'];
- $delpartpris5 = $info['delpartpris5'];
- $delpartpris6 = $info['delpartpris6'];
- $delpartpris7 = $info['delpartpris7'];
- $delpartpris8 = $info['delpartpris8'];
- $delpartpris9 = $info['delpartpris9'];
- $delpartpris10 = $info['delpartpris10'];
- $tstart = $info['tstart'];
- $tslut = $info['tslut'];
- $tforbrug = $info['tforbrug'];
- $total = $info['total'];
- $kkm = $info['kkm'];
- $krute = $info['krute'];
- }
-
- mysql_close();
- break;
- }
- }
- ?>
- <br/>
- <p>ID:<span style="padding-left:19px"></span>
- <textarea cols="25" rows="1" name="ID2" tabindex="2" readonly><?php echo htmlentities($ID); ?></textarea><span style="padding-left:200px"></span>
-
- <br/>
- <p>Navn:<span style="padding-left:19px"></span>
- <textarea cols="25" rows="1" name="name" tabindex="3"><?php echo htmlentities($name); ?></textarea><span style="padding-left:200px"></span>
- Mærke:
- <span style="padding-left:6px"></span><textarea cols="10" rows="1" name="maerke" tabindex="9"><?php echo htmlentities($maerke); ?></textarea>
- <br/>
- Adresse:
- <textarea cols="25" rows="1" name="address" tabindex="4"><?php echo htmlentities($address); ?></textarea><span style="padding-left:200px"></span>
-
- Serie nr:
- <textarea cols="10" rows="1" name="serienr" tabindex="10"><?php echo htmlentities($serienr); ?></textarea>
- <br/>
- Postnr:
- <span style="padding-left:9px"></span><textarea cols="10" rows="1" name="postnr" tabindex="5"><?php echo htmlentities($postnr); ?></textarea><span style="padding-left:320px"></span>
-
- Model:
- <span style="padding-left:11px"></span><textarea cols="10" rows="1" name="model" tabindex="11"><?php echo htmlentities($model); ?></textarea>
- <br/>
- Tlf:
- <span style="padding-left:34px"></span><textarea cols="10" rows="1" name="tlf" tabindex="6"><?php echo htmlentities($tlf); ?></textarea>
- <br/>
- E-mail:
- <span style="padding-left:12px"></span><textarea cols="10" rows="1" name="email" tabindex="7"><?php echo htmlentities($email); ?></textarea>
- <br/>
- By:
- <span style="padding-left:35px"></span><textarea cols="10" rows="1" name="by" tabindex="8"><?php echo htmlentities($by); ?></textarea><span style="padding-left:200px"></span>
- <br/><br/>
-
- Ekstra udstyr: <span style="padding-left:291px"></span>Fejlbeskrivelse / udført arbejde:
- <br/>
-
- <textarea cols="30" rows="5" name="extraudstyr" tabindex="12"><?php echo htmlentities($extraudstyr); ?></textarea>
- <span style="padding-left:121px"></span>
- <textarea cols="30" rows="5" name="fejlbeskrivelse" tabindex="13"><?php echo htmlentities($fejlbeskrivelse); ?></textarea>
- <br/><br/>
- Del/Partnr1:
- <span style="padding-left:7px"></span>
- <textarea cols="30" rows="1" name="delpartnr1" tabindex="14"><?php echo htmlentities($delpartnr1); ?></textarea>
-
- Pris:
- <textarea cols="10" rows="1" name="delpartpris1" tabindex="15"><?php echo htmlentities($delpartpris1); ?></textarea>
- <br/>
- Del/Partnr2:
- <span style="padding-left:7px"></span>
- <textarea cols="30" rows="1" name="delpartnr2" tabindex="16"><?php echo htmlentities($delpartnr2); ?></textarea>
-
- Pris:
- <textarea cols="10" rows="1" name="delpartpris2" tabindex="17"><?php echo htmlentities($delpartpris2); ?></textarea>
- <br/>
- Del/Partnr3:
- <span style="padding-left:7px"></span>
- <textarea cols="30" rows="1" name="delpartnr3" tabindex="18"><?php echo htmlentities($delpartnr3); ?></textarea>
-
- Pris:
- <textarea cols="10" rows="1" name="delpartpris3" tabindex="19"><?php echo htmlentities($delpartpris3); ?></textarea>
- <br/>
- Del/Partnr4:
- <span style="padding-left:7px"></span>
- <textarea cols="30" rows="1" name="delpartnr4" tabindex="20"><?php echo htmlentities($delpartnr4); ?></textarea>
-
- Pris:
- <textarea cols="10" rows="1" name="delpartpris4" tabindex="21"><?php echo htmlentities($delpartpris4); ?></textarea>
- <br/>
- Del/Partnr5:
- <span style="padding-left:7px"></span>
- <textarea cols="30" rows="1" name="delpartnr5" tabindex="22"><?php echo htmlentities($delpartnr5); ?></textarea>
-
- Pris:
- <textarea cols="10" rows="1" name="delpartpris5" tabindex="23"><?php echo htmlentities($delpartpris5); ?></textarea>
- <br/>
- Del/Partnr6:
- <span style="padding-left:7px"></span>
- <textarea cols="30" rows="1" name="delpartnr6" tabindex="24"><?php echo htmlentities($delpartnr6); ?></textarea>
-
- Pris:
- <textarea cols="10" rows="1" name="delpartpris6" tabindex="25"><?php echo htmlentities($delpartpris6); ?></textarea>
- <br/>
- Del/Partnr7:
- <span style="padding-left:7px"></span>
- <textarea cols="30" rows="1" name="delpartnr7" tabindex="26"><?php echo htmlentities($delpartnr7); ?></textarea>
-
- Pris:
- <textarea cols="10" rows="1" name="delpartpris7" tabindex="27"><?php echo htmlentities($delpartpris7); ?></textarea>
- <br/>
- Del/Partnr8:
- <span style="padding-left:7px"></span>
- <textarea cols="30" rows="1" name="delpartnr8" tabindex="28"><?php echo htmlentities($delpartnr8); ?></textarea>
-
- Pris:
- <textarea cols="10" rows="1" name="delpartpris8" tabindex="29"><?php echo htmlentities($delpartpris8); ?></textarea>
- <br/>
- Del/Partnr9:
- <span style="padding-left:7px"></span>
- <textarea cols="30" rows="1" name="delpartnr9" tabindex="30"><?php echo htmlentities($delpartnr9); ?></textarea>
-
- Pris:
- <textarea cols="10" rows="1" name="delpartpris9" tabindex="31"><?php echo htmlentities($delpartpris9); ?></textarea>
- <br/>
- Del/Partnr10:
- <textarea cols="30" rows="1" name="delpartnr10" tabindex="32"><?php echo htmlentities($delpartnr10); ?></textarea>
- Pris:
- <textarea cols="10" rows="1" name="delpartpris10" tabindex="33"><?php echo htmlentities($delpartpris10); ?></textarea>
- <br/>
- Pris total:<span style="padding-left:23px"></span>
- <textarea cols="10" rows="1" name="total" tabindex="34"><?php echo htmlentities($total); ?></textarea>
- <br/><br/><br/>
- Indleveringsdato:
- <span style="padding-left:25px"></span>
- <textarea cols="15" rows="1" name="indlaveringsdato" tabindex="35"><?php echo htmlentities($indlaveringsdato); ?></textarea>
- Udleveringsdato:
- <span style="padding-left:25px"></span>
- <textarea cols="15" rows="1" name="udlaveringsdato" tabindex="36"><?php echo htmlentities($udlaveringsdato); ?></textarea>
- <br/>
- Kørsel rute:
- <textarea cols="30" rows="1" name="krute" tabindex="37"><?php echo htmlentities($krute); ?></textarea>
- <br/>
- Kørsel Km:
- <span style="padding-left:8px"></span>
- <textarea cols="30" rows="1" name="kkm" tabindex="38"><?php echo htmlentities($kkm); ?></textarea>
- <br/>
- Tid start:
- <span style="padding-left:15px"></span>
- <textarea cols="30" rows="1" name="tstart" tabindex="39"><?php echo htmlentities($tstart); ?></textarea>
- <br/>
- Tid slut:
- <span style="padding-left:22px"></span>
- <textarea cols="30" rows="1" name="tslut" tabindex="40"><?php echo htmlentities($tslut); ?></textarea>
- <br/>
- Tid brugt:
- <span style="padding-left:11px"></span>
- <textarea cols="30" rows="1" name="tforbrug" tabindex="41"><?php echo htmlentities($tforbrug); ?></textarea>
- <br/>
- Reparation udført af:
- <textarea cols="30" rows="1" name="reparationudfortaf" tabindex="42"><?php echo htmlentities($reparationudfortaf); ?></textarea>
- <br/>
- <?php
-
- ?>
- <br/>
- </div>
- </div>
- <div id="footer">
- <p>Copyright © SKP_DATA <u><em>Frederik Rasmussen</em></u><em></em></p>
- </div>
- </div>
- </body>
- </html>
håber i kan hjælpe mig.
Hilsen Frederik